package com.ssc.chain.tcfp.core.client;

/**
 * @author mingjian
 * @version 1.0
 * Create by 2025/7/10 17:47
 */
public interface DistributedLock {

    /**
     * 尝试加锁
     * @param key 锁的key
     * @param timeoutMs 超时时间
     * @return 是否成功加锁
     */
    boolean tryLock(String key, long timeoutMs);

    /**
     * 释放锁
     * @param key 锁的key
     */
    void unlock(String key);
}
